import * as React from 'react';
import { RouteChildrenProps } from 'react-router';
import './styles/index.less';
import Layout from '@/pages/layout/default';
import { connect } from '@/common/core';
import { IAppModelState } from '@/models/app';
import { Link } from 'react-router-dom';

interface BaseProps {}

export type AppProps = {} & BaseProps & IAppModelState;

export interface AppState {}

class App extends React.Component<AppProps & RouteChildrenProps, AppState> {
  static propTypes = {};
  state = {};

  render() {
    return (
      <Layout>
        <div className="v-page-route-app" style={{ padding: 20 }}>
          <div>{this.props.title}</div>
          <div>
            <Link to="/dispatch-page">功能开发</Link>
          </div>
          <div>
            <Link to="/react">React组件测试</Link>
          </div>
        </div>
      </Layout>
    );
  }
}

export default connect(({ app }: { app: IAppModelState }) => ({
  title: app.title,
}))(App);
